package com.bdqn.mapper;

import com.bdqn.entity.PmsSku;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bdqn.entity.responseDate.pmsProduct.PmsSkuDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商品sku表 Mapper 接口
 * </p>
 *
 * @author hunter
 * @since 2022-04-30
 */
public interface PmsSkuMapper extends BaseMapper<PmsSku> {
    List<PmsSkuDto> getPmsSkuDtoBySpuId(Long spuId);
    //获取购物车存储的 通过skuid查询的sku信息
    PmsSkuDto pmsSkuDto(@Param("skuId") Long skuId);

    int updateStock(@Param("skuNum") Integer skuNum, @Param("skuId") Long skuId);

    //回滚商品sku库存
    Integer rollbackInventory(@Param("skuNum") Integer skuNum, @Param("skuId") Long skuId);
}
